package cn.curry.feign;

import cn.curry.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UseServiceFallback implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User getUserById(Long id) {
                return new User(-1L,"熔断了","你已经被熔断了哦！");
            }
        };
    }
}
